1. Field of the Invention
The present invention relates to an image processing technology, particularly, to a method for processing digital images in order to automatically improve and enhance the visual quality of the digital images.
2. Description of the Related Technology
With the development of digital technology, digital cameras and digital video cameras have already entered into people's life. The remarkable difference between a digital camera and an ordinary photographic camera is that the digital camera stores a picture in numeric data. However, the digital camera does not use a roll of the film as that used in the ordinary photographic camera. This makes the digital camera smaller in size and easier to carry. In addition, digital images can be transferred to different kinds of image processing devices. By using these image process devices, various image post-processing techniques can be applied to images to improve the quality thereof when the images involve defects such as backlighting defects, underexposure defects, overexposure defects, contrast defects and color casting defects. The resulting quality of the processed photos may not be possibly produced by optics lens photography.
Photos taken by the digital camera are not always desirable. Firstly, the automatic exposure system of the digital camera is not always correct. For instance, due to wrong exposure detection, faces of a portrait photo taken under strong backlight may be underexposed. Furthermore, due to the loss of dynamic range when the image is digitized or compressed by a lossy compression algorithm (like JPEG or MPEG), in recording scenes with a very high dynamic range, digital cameras will make compromises that allow only the important part of the scene captured. As a result, some parts of the captured image may be washed out or flattened. The captured image will be very different from what human eyes can see in the real situation. On the other hand, the power of typical build-in flashlight is normally not powerful enough to fill on the distant objects. In a more extreme case, some cheaper cameras do not have a build-in flashlight. As a result, photos taken in dim environment are dark and the objects cannot be seen clearly. Accordingly, there is an essential need to make enhancement on digital images taken by digital cameras in order to get good photos under varies lighting conditions.
In existing automatic photo enhancement processes, methods of “Auto Level” and “Auto Contrast” only try to globally widen the dynamic range of an image. Poorly exposed photo with full dynamic range cannot be corrected by these methods. For example, the current methods cannot correct a backlight photo that has a very high contrast and full dynamic range. For the automatic method of “Histogram Equalization”, a global transformation function is constructed for a specific image. This algorithm just works well in case the histogram of the image is uniform, whereas some parts of the image are too bright and the other parts are too dark. If the histogram of an image does not have a uniform property, histogram equalization may produce erroneous color and unnatural looking. For example, the face of a person in the image will become very dull. The methods mentioned above do not identify whether exposure defects exist on an image or not. They just try to modify an input image until the output image satisfies certain statistic criterions. With such a criterion, undesirable results may be produced. In reality, to enhance a digital image by software, a user has to adjust different parameters manually (e.g. levels, curves, brightness, contrast and saturation). This involves lots of trials and errors. Since these enhancement methods always adjust images globally, regions of the image that are originally good may be distorted (e.g. washed out or flattened) after being processed.